home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / basic / ace24dist.lha / ace24.lha / include / Exec / memory.h < prev    next >
C/C++ Source or Header  |  1996-09-10  |  4KB  |  137 lines

  1. #ifndef EXEC_MEMORY_H
  2. #define EXEC_MEMORY_H 1
  3. /*
  4. ** memory.h for ACE Basic
  5. **
  6. ** Note: Translated to ACE by ConvertC2ACE
  7. **       @ MapMeadow Software, Nils Sjoholm
  8. **
  9. **
  10. ** Date: 09/02/95
  11. **
  12. **
  13. */
  14.  
  15.  
  16. /*
  17. ** This are the StructPointer defines for memory.h
  18. */
  19. #ifndef MemChunkPtr
  20. #define MemChunkPtr ADDRESS
  21. #endif
  22. #ifndef MemEntryPtr
  23. #define MemEntryPtr ADDRESS
  24. #endif
  25. #ifndef MemHandlerDataPtr
  26. #define MemHandlerDataPtr ADDRESS
  27. #endif
  28. #ifndef MemHeaderPtr
  29. #define MemHeaderPtr ADDRESS
  30. #endif
  31. #ifndef MemListPtr
  32. #define MemListPtr ADDRESS
  33. #endif
  34. #ifndef me_Un_StructPtr
  35. #define me_Un_StructPtr ADDRESS
  36. #endif
  37. /*
  38. ** End of StructPointer defines for memory.h
  39. */
  40.          
  41. #ifndef EXEC_NODES_H
  42. #include <exec/nodes.h>
  43. #endif /* EXEC_NODES_H */
  44.  
  45.  
  46. /****** MemChunk ****************************************************/
  47.  
  48. STRUCT  MemChunk  
  49.     MemChunkPtr  mc_Next   /* pointer to next chunk */
  50.     LONGINT   mc_Bytes        /* chunk byte size  */
  51. END STRUCT 
  52.  
  53.  
  54. /****** MemHeader ***************************************************/
  55.  
  56. STRUCT  MemHeader  
  57.     Node mh_Node 
  58.     SHORTINT   mh_Attributes   /* characteristics of this region */
  59.     MemChunkPtr  mh_First  /* first free region        */
  60.     ADDRESS    mh_Lower        /* lower memory bound       */
  61.     ADDRESS    mh_Upper        /* upper memory bound+1 */
  62.     LONGINT   mh_Free         /* total number of free bytes   */
  63. END STRUCT 
  64.  
  65.  
  66. /****** MemEntry ****************************************************/
  67.  
  68. STRUCT me_Un_Struct  
  69.     LONGINT   meu_Regs 
  70.     ADDRESS    meu_Addr 
  71. END STRUCT 
  72.  
  73. STRUCT  MemEntry  
  74.     me_Un_Struct me_Un 
  75.                            /* the AllocMem requirements */
  76.                            /* the address of this memory region */
  77.     LONGINT   me_Length       /* the length of this memory region */
  78. END STRUCT 
  79.  
  80. #define me_un       me_Un_Struct   /* compatibility - do NOT use*/
  81. #define me_Reqs     me_Un_Struct->meu_Reqs
  82. #define me_Addr     me_Un_Struct->meu_Addr
  83.  
  84.  
  85. /****** MemList *****************************************************/
  86.  
  87. /* Note: sizeof(STRUCT MemList) includes the size of the first MemEntry! */
  88. STRUCT  MemList  
  89.     Node ml_Node 
  90.     SHORTINT   ml_NumEntries   /* number of entries in this STRUCT */
  91.     STRING ml_ME SIZE 8      /* the first entry  */
  92. END STRUCT 
  93.  
  94. #define ml_me   ml_ME       /* compatability - do not use */
  95.  
  96.  
  97. /*----- Memory Requirement Types ---------------------------*/
  98. /*----- See the AllocMem() documentation for details--------*/
  99.  
  100. #define MEMF_ANY    (0&)    /* Any type of memory will do */
  101. #define MEMF_PUBLIC (1&)
  102. #define MEMF_CHIP   (2&)
  103. #define MEMF_FAST   (4&)
  104. #define MEMF_LOCAL  (256&) /* Memory that does not go away at RESET */
  105. #define MEMF_24BITDMA (512&)   /* DMAable memory within 24 bits of address */
  106. #define MEMF_KICK   (1024&)    /* Memory that can be used for KickTags */
  107.  
  108. #define MEMF_CLEAR   (65536&)   /* AllocMem: NULL out area before return */
  109. #define MEMF_LARGEST (131072&)   /* AvailMem: return the largest chunk size */
  110. #define MEMF_REVERSE (262144&)   /* AllocMem: allocate from the top down */
  111. #define MEMF_TOTAL   (524288&)   /* AvailMem: return total size of memory */
  112.  
  113. #define MEMF_NO_EXPUNGE (2147483648&) /*AllocMem: Do not cause expunge on failure */
  114.  
  115. /*----- Current alignment rules for memory blocks (may increase) -----*/
  116. #define MEM_BLOCKSIZE   8&
  117. #define MEM_BLOCKMASK   (MEM_BLOCKSIZE-1)
  118.  
  119.  
  120. /****** MemHandlerData **********************************************/
  121. /* Note:  This structure is *READ ONLY* and only EXEC can create it!*/
  122. STRUCT MemHandlerData
  123.  
  124.     LONGINT   memh_RequestSize    /* Requested allocation size */
  125.     LONGINT   memh_RequestFlags   /* Requested allocation flags */
  126.     LONGINT   memh_Flags      /* Flags (see below) */
  127. END STRUCT 
  128.  
  129. #define MEMHF_RECYCLE   (1) /* 0==First time,  1==recycle */
  130.  
  131. /****** Low Memory handler return values ***************************/
  132. #define MEM_DID_NOTHING (0) /* Nothing we could do... */
  133. #define MEM_ALL_DONE    (-1)    /* We did all we could do */
  134. #define MEM_TRY_AGAIN   (1) /* We did some,  try the allocation again */
  135.  
  136. #endif  /* EXEC_MEMORY_H */
  137.